﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace ParticlesEngine
{
//ESTRUCTURA DE ENTRADA DEL SHADER
//    struct VertexShaderInput
//{
//    float3 Position : POSITION0;
//    float3 Velocity : NORMAL0;
//    float4 Random : COLOR0;
//    float Time : TEXCOORD0;
//};
    struct Particle{
        public Vector3 position;            //posicion que debe coincidir con la de la estructura de entrada del shader
        public Vector3 velocity;            //velocidad
        public Color random;                //valores random 4
        public float time;                  //creation time
        public Vector3 acceleration;

        public Vector3 previousPosition;
        public float timeLife;              //life time, after that, die.
        public float size;
        public float previousSize;
        public float weight;
        public float previousWeight;

        public Color color;
        public Color delta;        //how color changes related to time.

        
        //TODO esto no tengo muy claro para que sirve
        // Describe the layout of this vertex structure.
        public static readonly VertexElement[] VertexElements =
        {
            new VertexElement(0, 0, VertexElementFormat.Vector3,
                                    VertexElementMethod.Default,
                                    VertexElementUsage.Position, 0),

            new VertexElement(0, 12, VertexElementFormat.Vector3,
                                     VertexElementMethod.Default,
                                     VertexElementUsage.Normal, 0),

            new VertexElement(0, 24, VertexElementFormat.Color,
                                     VertexElementMethod.Default,
                                     VertexElementUsage.Color, 0),

            new VertexElement(0, 28, VertexElementFormat.Single,
                                     VertexElementMethod.Default,
                                     VertexElementUsage.TextureCoordinate, 0),
        };
        //Vector3 12 bytes,
        //float 4 bytes,
        //Color 4 bytes
        // 12*4 + 4*6 + 4*3 = 84
        public const int SizeInBytes = 84;
    }
}
